package com.samphanie.common.execetion;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @Description: 自定义异常
 * @Author ZSY
 * @createTime 2021/4/19 17:50
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class ApiException extends RuntimeException {

    private IErrorCode errorCode;

    public ApiException(IErrorCode errorCode) {
        super(errorCode.getMessage());
        this.errorCode = errorCode;
    }

    public ApiException(String message) {
        super(message);
    }

    public ApiException(Throwable cause) {
        super(cause);
    }

    public ApiException(String message, Throwable cause) {
        super(message, cause);
    }

}
